import java.util.Scanner;

//题目：利用递归方法求5!
public class Test22 {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);
        System.out.println("请输入一个数");
        int numb = console.nextInt();
        long all = calculate(numb);
        System.out.print(numb + "！= " + all);
    }

    public static int calculate(int n) {
        if (n == 1) {
            return 1;
        }
        return n * calculate(n - 1);
    }
}
